package com.thb.pay.core.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.thb.pay.core.enums.SensitiveTypeEnum;
import com.thb.pay.core.json.SensitiveInfoSerialize;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @类名称 SensitiveInfo
 * @类描述 <pre>脱敏注解</pre>
 * @作者 lucky
 * @创建时间 2019/11/11
 * @版本 v1.01
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveInfoSerialize.class)
public @interface SensitiveInfo {
    /**
     * 脱敏规则类型
     *
     * @return
     */
    SensitiveTypeEnum value();

    /**
     * 附加值, 自定义正则表达式等
     *
     * @return
     */
    String[] attach() default "";
}
